﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace ClassAndObjectExamples
{
    public partial class Student : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnOk_Click(object sender, EventArgs e)
        {
            StudentLib.BaseStudent s = new StudentLib.TransferStudent(true);  //make an object
            //TransferStudent is a subclass of Student which is a subclass of BaseStudent 
            //StudentLib.TransferStudent s = new StudentLib.TransferStudent(true);
            s = new StudentLib.TransferStudent("Univ. Of Bridgeport", true);

            StudentLib.IAttendClass a = new StudentLib.TransferStudent("Univ of Bridgeport", true);
            StudentLib.IRegister r = new StudentLib.Student(true); 
            

            s.FirstName = txtFirstName.Text;
            s.LastName = txtLastName.Text;
            s.StreetAddress = txtStreetAddresss.Text;
            s.City = txtCity.Text;
            s.State = txtState.Text;
            s.Zip = txtZip.Text;

            lblMailingLabel.Text = s.MailingLabel();
        }

        protected void btnClear_Click(object sender, EventArgs e)
        {
            txtFirstName.Text = "";
            txtLastName.Text = "";
            txtStreetAddresss.Text = "";
            txtCity.Text = "";
            txtState.Text = "";
            txtZip.Text = "";

            lblMailingLabel.Text = "";
        }
    }
}